/*
 * To  change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package persistencia;

/**
 *
 * @author JAVA
 */
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;

public class PTarifa {

    public static void seleccionarPorIdBD(int id) {
        Connection connection = null;
        Statement statement = null;
        ResultSet resultSet = null;

        try {
            Class.forName("com.mysql.jdbc.Driver");
            connection = DriverManager.getConnection("jdbc:mysql://192.168.1.21/bitclub", "bituser", "bituser");
            statement = connection.createStatement();
            resultSet = statement.executeQuery("SELECT NOMBRE, DIRECCION, LOCALIDAD FROM VIDEOCLUB");

            while (resultSet.next()) {

                System.out.println("nombre=" + resultSet.getString("nombre") + ", direccion=" + resultSet.getString("direccion") + ", localidad=" + resultSet.getString("localidad"));

            }

        } catch (Exception ex) {
        } finally {
            try {
                resultSet.close();
            } catch (Exception ex) {
                //Logger.getLogger(PersistenciaPrueba.class.getName()).log(Level.SEVERE, null, ex);
                System.out.println("Mensaje de Error");
            }

        }
    }
}
